<?php
/* @var $this PostCategoryController */
/* @var $model PostCategory */
/* @var $form CActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'post-category-form',
	'enableAjaxValidation'=>false,
	'htmlOptions' => array(
    	'enctype' => 'multipart/form-data'
     )	
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'parent_id'); ?>
		<?php echo $form->dropDownList($model, 'id', CHtml::listData(PostCategory::model()->findAllByAttributes(array('status' => 1, 'parent_id' => '!0')), 'id', 'title'), array('empty' => array(0 => Yii::t('app', 'Parent category')))); ?>
		<?php echo $form->error($model,'parent_id'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'title'); ?>
		<?php echo $form->textField($model,'title',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'title'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'thumbnail'); ?>
		<?php echo $form->fileField($model,'thumbnail'); ?>
		<?php echo $form->error($model,'thumbnail'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'status'); ?>
		<?php echo $form->dropDownList($model,'status', array(0 => Yii::t('app', 'unPublic'), 1 => Yii::t('app', 'public'))); ?>
		<?php echo $form->error($model,'status'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'show_menu'); ?>
		<?php echo $form->dropDownList($model,'show_menu', array(0 => Yii::t('app', 'no'), 1 => Yii::t('app', 'yes'))); ?>
		<?php echo $form->error($model,'show_menu'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'sorter'); ?>
		<?php echo $form->textField($model,'sorter'); ?>
		<?php echo $form->error($model,'sorter'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'seo_link'); ?>
		<?php echo $form->textField($model,'seo_link',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'seo_link'); ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->